package com.zfei.gfb.request.h5;


import com.zfei.gfb.bean.Status;
import com.zfei.gfb.bean.StatusException;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @author fgh
 */
@Data
@ApiModel("自动登录接口入参-/h5/login/auto")
public class OpenIdRequest {

    // openId
    @ApiModelProperty(value = "微信openId", required = true, notes = "微信账号唯一")
    private String openId;

    @ApiModelProperty("手机号")
    private String uuid;

    //工分宝跳转过来
    public boolean autoValidateVillager() {
        return uuid != null;
    }

    public void checkParam() {
        if (StringUtils.isAnyBlank(openId)) {
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
    }
}

